type IndexType = string | number | symbol;

export type GeneralFunction<T = unknown> = (...args: any[]) => T;

export type PlainObject<K extends IndexType = string, V = unknown> = Record<K, V>;

export type PrimitiveType = number | string | boolean | undefined | null | symbol;

export interface RecordDTO extends PlainObject {
    id: number;
}

export interface CommentItem extends PlainObject {
    id?: number;
    parentId: number;
    articleId?:number;
    name?: string;
    time?: string;
    content: string;
    uid?: number;
    imgpath?: string;
    children?: CommentItem[];
}

export interface UserDTO extends RecordDTO {
    role_id: number;
    role_name: string;
    user_name: string;
    avatar: string;
    last_login_time: string;
}


// 响应Model
export interface MyResponse<T = unknown> {
    state: string;
    msg: string;
    data?: T | T[];
}